﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace RainingNight
{
    enum Dir
    {
        NONE, UP, RIGHT, DOWN, LEFT,
    };

    class MoveAbillity
    {
        private float m_fSpeed;
        private Vector2 m_Speed;
        private Dir m_Direction;

        public MoveAbillity()
        {
            m_fSpeed = 0.0f;
            m_Direction = Dir.NONE;
            Speed = new Vector2(0, 0);
        }


        private Vector2 SpeedVector()
        {
            switch (Direction)
            {
                case Dir.UP:
                    return -m_fSpeed * Vector2.UnitY;
                case Dir.DOWN:
                    return m_fSpeed * Vector2.UnitY;
                case Dir.RIGHT:
                    return m_fSpeed * Vector2.UnitX;
                case Dir.LEFT:
                    return -m_fSpeed * Vector2.UnitX;
                case Dir.NONE:
                    return Vector2.Zero;
                default:
                    return Vector2.Zero;
            }
        }

        public Vector2 Speed
        {
            get { return m_Speed; }
            private set { m_Speed = value; }
        }

        public float fSpeed
        {
            get { return m_fSpeed; }
            set
            {
                m_fSpeed = value;
                Speed = SpeedVector();
            }
        }

        public Dir Direction
        {
            get { return m_Direction; }
            set
            {
                m_Direction = value;

                Speed = SpeedVector();

            }
        }

    }

}
